const fs = require('fs')
// 读取文件
function readFile(path,bm='utf-8') {
    let rf = new Promise((resolve, reject) => {
        fs.readFile(path, bm, (err, res) => {
            if (err) return err;
            resolve(JSON.parse(res))
        })
    })
    return rf
}
module.exports = {
    async getData() {
        return await readFile('./data.json', 'utf-8');
    }
}
